home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / mods / psid / nemesids-extras.lzh / Utils / PlaySIDRandom.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1994-10-14  |  895 b   |  46 lines

  1. /*
  2.     $Ver 1.0
  3.     Random Load & Play of PlaySID 3.0 tunes
  4.     Uses the ASCII file created by PSIDExtract
  5.     (C) 1994.7.1 Jan Diabelez Harries
  6. */
  7.  
  8. options results
  9.  
  10. IF ~SHOW(Ports,'PLAYSID') THEN DO
  11.     ADDRESS COMMAND 'CD SID:'"0a"X'RUN SID:PlaySID'
  12.     ADDRESS COMMAND 'WaitForPort PLAYSID'
  13. END
  14.  
  15. address 'PLAYSID'
  16.  
  17. /* List of PlaySID music; you should enter your own list here */
  18. filename='DATA:SuperData/PlaySidMusic.asc'
  19.  
  20. x=OPEN(f,filename,'R')
  21. IF x=0 THEN RETURN(10);
  22. filelenght=SEEK(f,0,'E')
  23.  
  24. location =TRUNC(filelenght * randu(time('S')))
  25.  
  26. CALL SEEK(f,location,'B')
  27. line=READLN(f)
  28. IF EOF(f) THEN EXIT(10);
  29. line=READLN(f)
  30. CALL CLOSE(f)
  31.  
  32. PARSE VAR line songs '","' a1 '","' a2 '","' a3 '","' SIDName
  33. songs = COMPRESS(songs,'"')
  34. PARSE VAR songs s1 ',' s2
  35.  
  36. IF s2 == "" THEN
  37.     s2 = 1
  38.  
  39. SIDName = COMPRESS(SIDName,'"')
  40. SID_LOAD(SIDName)
  41.  
  42. /* If you have PlaySID 3.0, you do not need this line! */
  43. SID_PLAY()
  44.  
  45. exit
  46.